package pw.jeb;

import java.io.Serializable;

/**
 * @Author Eric
 * @Desc
 * @Date Create in 18-2-7 下午3:03
 * @Modified By
 */
public class Event implements Serializable {
    private String type;
    private int what ;
    private Object obj;

    public Event(String type){
        this.type = type;
    }

    public Event(Event e){
        this.type = e.type;
        this.obj = e.obj;
        this.what = e.what;
    }

    public static Event obtain(String type){
        return new Event(type);
    }

    public static Event obtain(Event event){
        return new Event(event);
    }

    public static Event obtain(String type,int what){
        return obtain(type,what,null);
    }

    public static Event obtain(String type,Object obj){
        return obtain(type,0,obj);
    }

    public static Event obtain(String type,int what,Object obj){
        Event event = new Event(type);
        event.what = what;
        event.obj = obj;
        return event;
    }


    public String type(){
        return type;
    }

    public int getWhat() {
        return what;
    }

    public void setWhat(int what) {
        this.what = what;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
}
